import { FORM_DIRECTIVES } from '@angular/common';
import { Component } from '@angular/core';

@Component({
    moduleId: module.id,
    selector: 'sd-login',
    templateUrl: 'login.component.html',
    styleUrls: ['login.component.css'],
    directives: [FORM_DIRECTIVES]
})

export class LoginComponent {
    lang: string;

    headerText: string;
    inputEmail: string;
    inputPassword: string;
    remember_me: string;
    submitBtn: string;

    email: string;
    password: string;
    remember: boolean;

    constructor(){
        this.lang = 'cn';

        switch (this.lang) {
            case 'cn':
                this.headerText    = '请登录';
                this.inputEmail    = '用户ID';
                this.inputPassword = '密码';
                this.remember_me   = '记住我';
                this.submitBtn     = '登录';
            break;
            case 'en':
            default:
                this.headerText    = 'Please Login';
                this.inputEmail    = 'Username';
                this.inputPassword = 'Password';
                this.remember_me   = 'Remember Me';
                this.submitBtn     = 'Login';
            break;
        }
    }

    login(): boolean {
        this.remember = !!this.remember;
        console.log(this.email, this.password, this.remember);
        return false;
    }
}
